def run(params:list[str]):
    from ApiBase import apiBase
    import json
    try:
        content = apiBase.argv(1,"if a=1 end\n b=1\n if c =1 end\n")
        reg1 = apiBase.argv(2,r'if.*?end|else.*?end')
        reg2 = apiBase.argv(3)
        blockname = apiBase.argv(4,"----blockname")
        maxtoken = apiBase.argv(5,8000)

        apiBase.lsExpress=[]
        content=apiBase.cut_all(maxtoken,content,apiBase.lsExpress,reg1,reg2,blockname)
        sz=len(apiBase.lsExpress)
        for i in range(sz):
            apiBase.lsExpress[i]=apiBase.encode64(apiBase.lsExpress[i])
        ret={"content":apiBase.encode64(content),"blockname":blockname,"express":apiBase.lsExpress}
        print(json.dumps(ret, indent=4, ensure_ascii=False))
    finally:
        apiBase.close()


